import axios from '@/libs/api.request'
import config from '@/config'

export const getCustomerTable = async (playload) => {
  const resp = await axios.request({
    url: config.apiUrl,
    params: {
      module: 'CustomerService.view',
      ...playload
    },
    method: 'get'
  })
  return resp
}

export const editCustomerRecord = async (playload) => {
  const data = {
    module: 'CustomerService.update',
    ...playload
  }
  const resp = await axios.request({
    url: config.postUrl,
    data,
    method: 'post'
  })
  return resp
}

// 获取内部销售列表
export const getCustomerInsideNameList = async () => {
  const resp = await axios.request({
    url: config.apiUrl,
    params: {
      module: 'UserService.namelist'
    },
    method: 'get'
  })
  return resp.data
}
